package com.xml.services;

import java.util.List;

import com.xml.dao.ReaderDao;
import com.xml.dao.ReaderDaoImpl;
import com.xml.domain.Reader;

public class ReaderServiceImpl implements ReaderService {
	ReaderDao rd;
	@Override
	public Reader insertReader(Reader reader) {
		rd = new ReaderDaoImpl();
		return rd.insertReader(reader);
	}

	@Override
	public boolean deleteReader(int id) {
		rd = new ReaderDaoImpl();
		return rd.deleteReader(id);
	}

	@Override
	public boolean updateReader(Reader reader) {
		rd = new ReaderDaoImpl();
		return rd.updateReader(reader);
	}

	@Override
	public List<Reader> searchReader() {
		rd = new ReaderDaoImpl();
		return rd.searchReader();
	}

	@Override
	public List<Reader> pagingQuery(int pageNo, int pageSize) {
		rd = new ReaderDaoImpl();
		return rd.pagingQuery(pageNo, pageSize);
	}

	@Override
	public Reader query_byId(int id) {
		rd = new ReaderDaoImpl();
		return rd.query_byId(id);
	}

	@Override
	public boolean checkReader(String id) {
		rd = new ReaderDaoImpl();
		return rd.checkReader(id);
	}

	@Override
	public int numOfBorrow(String id) {
		rd = new ReaderDaoImpl();
		return rd.numOfBorrow(id);
	}

	@Override
	public void updateNumOfBorrow(int id) {
		rd = new ReaderDaoImpl();
		rd.updateNumOfBorrow(id);
		
	}

	@Override
	public void setReaderId() {
		rd = new ReaderDaoImpl();
		rd.setReaderId();
	}

}
